package com.cweb.admin.model.bbs.bbs_article_info.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.cweb.admin.model.bbs.bbs_category_info.entity.BbsCategoryInfo;
import com.cweb.admin.model.sys.sys_user_info.entity.SysUserInfo;
import com.cweb.framework.base.entity.BaseMybatisModel;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 论坛-文章信息
 * @author changfan
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class BbsArticleInfo extends BaseMybatisModel {

    private static final long serialVersionUID=1L;

    /**
     * 物理id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 作者
     */
    @TableField(value = "`author`")
    private Long author;

    /**
     * 分类
     */
    @TableField(value = "`category`")
    private Long category;

    /**
     * 缩略图
     */
    @TableField(value = "`thumb`")
    private String thumb;

    /**
     * 标题
     */
    @TableField(value = "`title`")
    private String title;

    /**
     * 内容
     */
    @TableField(value = "`content`")
    private String content;

    /**
     * 文章版本号
     */
    @TableField(value = "`version`")
    private Integer version;
    /**
     * 点击数
     */
    @TableField(value = "`click_num`")
    private Integer clickNum;

    /**
     * 点赞数
     */
    @TableField(value = "`like_num`")
    private Integer likeNum;

    /**
     * 状态（0：正常已发布）
     */
    @TableField(value = "`status`", select = false)
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "`create_time`", select = false)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "`update_time`", select = false)
    private Date updateTime;

    /**
     * 备注
     */
    @TableField(value = "`remark`", select = false)
    private String remark;

    // 追加
    // 收藏数
    @TableField(exist = false)
    private Integer favorNum;
    // 用户信息
    @TableField(exist = false)
    private SysUserInfo user;
    // 主分类
    @TableField(exist = false)
    private BbsCategoryInfo mainCategory;
    // 子分类
    @TableField(exist = false)
    private BbsCategoryInfo subCategory;
    // 被用户收藏判断
    @TableField(exist = false)
    private Boolean bolFavor;
    // 收藏用户
    @TableField(exist = false)
    private Long favorUser;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
